# encoding=utf-8
import urllib
import re

import sys

import importlib,sys
importlib.reload(sys)
for word in open('E:\Python\kws.txt'):
    url = 'http://suggestion.baidu.com/su?wd=%s' % urllib.quote_plus(word)

    html = urllib.urlopen(url)
    content = html.read().decode('gbk', 'ignore')
    html.close()
    # print content
    r = re.compile(r'"(.+?)"')
    keywords = re.findall(r, content)
    for kws in keywords:
        print (kws)